- allTestData
int[] allTestData()
Dummy version so "normal" code compiles
- check
void check(int numFuncCalls = 100, in string file = __FILE__, in size_t line = __LINE__)
Same as unit_threaded.property.check
- checkCustom
void checkCustom(int numFuncCalls = 100, in string file = __FILE__, in size_t line = __LINE__)
Same as unit_threaded.property.checkCustom
- mock
auto mock()
Same as unit_threaded.mock.mock
- mockStruct
auto mockStruct(auto ref T returns)
Same as unit_threaded.mock.mockStruct
- runTests
int runTests(in string[] args)
int runTests(string[] args, T testData)
Dummy version of runTests so "normal" code compiles.
- shouldApproxEqual
void shouldApproxEqual(in V value, in E expected, string file = __FILE__, size_t line = __LINE__)
Assert that value is approximately equal to expected.
- shouldBeEmpty
void shouldBeEmpty(in auto ref R rng, in string file = __FILE__, in size_t line = __LINE__)
assert that rng is empty.
- shouldBeFalse
void shouldBeFalse(lazy E condition, in string file = __FILE__, in size_t line = __LINE__)
Throw if condition not false.
- shouldBeGreaterThan
void shouldBeGreaterThan(in auto ref T t, in auto ref U u, in string file = __FILE__, in size_t line = __LINE__)
Assert that t should be greater than u.
- shouldBeIn
void shouldBeIn(in auto ref T value, in auto ref U container, in string file = __FILE__, in size_t line = __LINE__)
void shouldBeIn(in auto ref T value, U container, in string file = __FILE__, in size_t line = __LINE__)
Assert that value is in container.
- shouldBeNull
void shouldBeNull(in auto ref T value, in string file = __FILE__, in size_t line = __LINE__)
- shouldBeSameJsonAs
void shouldBeSameJsonAs(in string actual, in string expected, in string file = __FILE__, in size_t line = __LINE__)
Assert that actual and expected represent the same JSON (i.e. formatting doesn't matter)
- shouldBeSameSetAs
void shouldBeSameSetAs(in auto ref V value, in auto ref E expected, in string file = __FILE__, in size_t line = __LINE__)
Assert that value is the same set as expected (i.e. order doesn't matter)
- shouldBeSmallerThan
void shouldBeSmallerThan(in auto ref T t, in auto ref U u, in string file = __FILE__, in size_t line = __LINE__)
Assert that t should be smaller than u.
- shouldBeTrue
void shouldBeTrue(lazy E condition, in string file = __FILE__, in size_t line = __LINE__)
Throw if condition is not true.
- shouldEqual
void shouldEqual(auto ref V value, auto ref E expected, in string file = __FILE__, in size_t line = __LINE__)
Assert value is equal to expected
- shouldNotBeEmpty
void shouldNotBeEmpty(in auto ref R rng, in string file = __FILE__, in size_t line = __LINE__)
Assert that rng is not empty.
- shouldNotBeIn
void shouldNotBeIn(in auto ref T value, in auto ref U container, in string file = __FILE__, in size_t line = __LINE__)
void shouldNotBeIn(in auto ref T value, U container, in string file = __FILE__, in size_t line = __LINE__)
Assert value is not in container.
- shouldNotBeNull
void shouldNotBeNull(in auto ref T value, in string file = __FILE__, in size_t line = __LINE__)
- shouldNotBeSameSetAs
void shouldNotBeSameSetAs(in auto ref V value, in auto ref E expected, in string file = __FILE__, in size_t line = __LINE__)
Assert that value is not the same set as expected.
- shouldNotEqual
void shouldNotEqual(in auto ref V value, in auto ref E expected, in string file = __FILE__, in size_t line = __LINE__)
Assert value is not equal to expected.
- shouldNotThrow
void shouldNotThrow(lazy E expr, in string file = __FILE__, in size_t line = __LINE__)
Assert that expr doesn't throw
- shouldThrow
void shouldThrow(lazy E expr, in string file = __FILE__, in size_t line = __LINE__)
- shouldThrowExactly
void shouldThrowExactly(lazy E expr, in string file = __FILE__, in size_t line = __LINE__)
Assert that expr throws an Exception that must have the type E, derived types won't do.
- shouldThrowWithMessage
void shouldThrowWithMessage(lazy E expr, string msg, string file = __FILE__, size_t line = __LINE__)
Assert that expr throws and the exception message is msg.
- writelnUt
void writelnUt(auto ref T args)
No-op version of writelnUt
This module is an attempt to alleviate compile times by including the bare minimum. The idea is that while the reporting usually done by unit-threaded is welcome, it only really matters when tests fail. Otherwise, no news is good news.
Likewise, naming and selecting tests are features used when certain tests fail. The usual way to run tests is to run all of them and be happy if they all pass.
This module makes it so that unit-threaded gets out of the way, and if needed the full features can be turned on at the cost of compiling much more slowly.
There aren't even any template constraints on the should functions to avoid imports as much as possible.